-
Notifications
You must be signed in to change notification settings - Fork 141
Send plugin names to Core #1157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| ) | ||
| .nexus_task_poller_behavior(conf.nexus_task_poller_behavior) | ||
| .plugins( | ||
| conf.plugins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, something that will need some discussion here. This PR reports worker plugins. We should discuss whether that is really what we intend. Plugins which exist only in the client and not the worker will be completely invisible. That could potentially be changed here at least for plugins in clients used by workers, though not generally for any client. I think that was something we didn't really think through when we decided to go with heartbeat as a carrier for this information, but maybe we conclude that is fine.
Typescript will be a bit more complicated as well with its additional plugin types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline, we will for now have both worker and client plugins and dedup names
Sushisource
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good to me, only thing is the default interval
Sushisource
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
…untime client identity requirement
c276572 to
e83a260
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Runtime Comparison Needs Proper Instance Resolution
The runtime comparison uses identity (is not) but doesn't properly handle when bridge_client.config.runtime is None. When the original client uses the default runtime (via None), self._runtime stores the actual default runtime object, but if a new client also has runtime=None in its config, the comparison self._runtime is not None incorrectly raises an error even though both clients use the same default runtime. The comparison should resolve both sides to actual runtime instances before comparing.
temporalio/worker/_worker.py#L648-L652
sdk-python/temporalio/worker/_worker.py
Lines 648 to 652 in bd5a404
| bridge_client = _extract_bridge_client_for_worker(value) | |
| if self._runtime is not bridge_client.config.runtime: | |
| raise ValueError( | |
| "New client is not on the same runtime as the existing client" | |
| ) |
| py: Python<'p>, | ||
| call: RpcCall, | ||
| ) -> PyResult<Bound<'p, PyAny>> { | ||
| use temporal_client::WorkflowService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a code generated file, you need to change the generator.
f56d819 to
5862a1e
Compare
| "temporalio_sdk", | ||
| ] | ||
| parts = [self.other_level] | ||
| parts.extend(f"{target}={self.core_level}" for target in targets) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Outdated Telemetry Target Breaks Rust Log Filtering
The TelemetryFilter.formatted() method includes "temporalio_sdk" as a target, but this doesn't match any actual Rust crate name. The crates were renamed from temporal_sdk_core, temporal_client, etc. to temporalio_sdk_core, temporalio_client, and temporalio_common. The target "temporalio_sdk" will never match any log output from the Rust code, preventing those logs from being filtered at the configured level. This should likely be "temporalio_sdk_core" (which is already in the list) or removed entirely.
| - run: uv sync --all-extras | ||
| - run: poe lint | ||
| - run: poe build-develop | ||
| - run: poe lint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Misleading artifact name for test job.
The artifact name includes --time-skipping but the test-latest-deps job doesn't actually run any time-skipping tests. The job only executes poe test -s --junit-xml=junit-xml/latest-deps.xml, so the artifact name is misleading and doesn't match the actual test content. This could cause confusion when reviewing test results.
e9565ab to
6ef144a
Compare
What was changed
Send plugin names over to core for worker heartbeating.
Updated Core to latest main, 9e9a461.
Updated test to validate replacing clients with a client from a different runtime is invalid.
Why?
Worker heartbeating
Checklist
Closes [Feature Request] Enable Worker Heartbeating #1196
How was this tested:
Added tests for plugin name propogation, and runtime options configuration
Note
Propagates worker plugin names to Core (via heartbeats), adds runtime worker-heartbeat options, migrates bridge to new temporalio_* crates, updates generated APIs/protos (cloud/workflowservice), and adjusts Python worker/runtime and tests accordingly.
temporal_client/temporal-sdk-core*totemporalio_client/temporalio_common/temporalio_sdk_corecrates; update deps (prost/tonic/opentelemetry).init_runtimenow takesRuntimeOptions(includesworker_heartbeat_interval_millis).replace_clientreturns error on failure.describe_worker,set_worker_deployment_manager, etc.).worker_heartbeat_interval; updates logging filter targets.WorkerTaskTypesandplugins; forward plugin names to Core.pluginslist; replayer sets task types.AuditLogSinkSpec,SetServiceAccountNamespaceAccess,ValidateAccountAuditLogSink; sink typesKinesisSpec,PubSubSpec.DescribeWorker,SetWorkerDeploymentManager; extend start/get-cluster/worker-deployment requests; minor doc tweaks.manager_identity); activation addslast_sdk_version.Written by Cursor Bugbot for commit d342c8d. This will update automatically on new commits. Configure here.